home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-27 | 836 b | 42 lines | [TEXT/PJMM] |
- unit SFGetFolder;
-
- interface
-
- function SFGetFolder (where: Point; var dirID: Longint): Boolean;
-
- const
- getFolderDlgID = -4001;
-
- implementation
-
- function FileFilter (pb: ParmBlkPtr): Boolean;
- begin
- FileFilter := True; {never show any file}
- end;
-
- function DialogHook (item: Integer; dlg: DialogPtr): Integer;
- const
- folderButton = 9; {replaces the horizontal divider}
- begin
- case item of
- folderButton:
- DialogHook := getOpen; {terminate the dialog}
- otherwise
- DialogHook := item;
- end;
- end;
-
- function SFGetFolder (where: Point; var dirID: Longint): Boolean;
- var
- typeList: SFTypeList;
- reply: SFReply;
- begin
- SFPGetFile(where, '', @FileFilter, -1, typeList, @DialogHook, reply, getFolderDlgID, nil);
- with reply do
- begin
- SFGetFolder := good;
- dirID := Longint(fType);
- end;
- end;
-
- end.